package com.java.test;

public class Point {
	// 属性：X，Y两个成员变量
	private int x;
	private int y;

	// 构造方法

	public Point() {
		super();

	}

	public Point(int x, int y) {
		this();

		this.x = x;
		this.y = y;
	}

	// 行为
	public void movePoint(int dx, int dy) {
		x = x + dx;
		y = y + dy;
		System.out.println("经过偏移后的坐标为：(" + x + "," + y + ")");

	}

	// getter，setter 方法
	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}
}
